/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import Datos.Partida;
import Datos.Tablero;
import Juego.Juego;

/**
 *
 * @author Pablo
 */
public class Menu extends javax.swing.JFrame {

    /**
     * Creates new form Menu
     */
    public Menu() {
        initComponents();
        this.setLocationRelativeTo(null);//Para que la ventana aparezca en el centro de la pantalla
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        buttonNuevaPar = new javax.swing.JButton();
        buttonReanudarPar = new javax.swing.JButton();
        buttonTutorial = new javax.swing.JButton();
        buttonEliminarPar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        buttonEstadisticas = new javax.swing.JButton();
        buttonSalir = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();

        this.setTitle( "Menu" );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        buttonNuevaPar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        buttonNuevaPar.setText("Nueva Partida");
        buttonNuevaPar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonNuevaParActionPerformed(evt);
            }
        });
        getContentPane().add(buttonNuevaPar);
        buttonNuevaPar.setBounds(126, 108, 137, 25);

        buttonReanudarPar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        buttonReanudarPar.setText("Reanudar Partida");
        buttonReanudarPar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonReanudarParActionPerformed(evt);
            }
        });
        getContentPane().add(buttonReanudarPar);
        buttonReanudarPar.setBounds(126, 151, 137, 25);

        buttonTutorial.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        buttonTutorial.setText("Tutorial");
        buttonTutorial.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonTutorialActionPerformed(evt);
            }
        });
        getContentPane().add(buttonTutorial);
        buttonTutorial.setBounds(126, 280, 137, 25);

        buttonEliminarPar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        buttonEliminarPar.setText("Eliminar Partida");
        buttonEliminarPar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonEliminarParActionPerformed(evt);
            }
        });
        getContentPane().add(buttonEliminarPar);
        buttonEliminarPar.setBounds(126, 194, 137, 25);

        jLabel1.setFont(new java.awt.Font("hooge 05_53", 1, 48)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("REVERSI");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(70, 36, 249, 42);

        buttonEstadisticas.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        buttonEstadisticas.setText("Estadisticas");
        buttonEstadisticas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonEstadisticasActionPerformed(evt);
            }
        });
        getContentPane().add(buttonEstadisticas);
        buttonEstadisticas.setBounds(126, 237, 137, 25);

        buttonSalir.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        buttonSalir.setText("Salir");
        buttonSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSalirActionPerformed(evt);
            }
        });
        getContentPane().add(buttonSalir);
        buttonSalir.setBounds(126, 323, 137, 25);

        jLabel2.setIcon(new javax.swing.ImageIcon("C:..\\Reversi\\images\\board1 (1) - copia.gif")); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(0, 0, 390, 410);

        pack();
    }// </editor-fold>

	private void buttonNuevaParActionPerformed(java.awt.event.ActionEvent evt) {                                               
    	this.setVisible(false);
    	VentanaPartida p = new VentanaPartida();
    	p.setVisible(true); 
    
    }                                              

    private void buttonReanudarParActionPerformed(java.awt.event.ActionEvent evt) {                                                  
    	this.setVisible(false);
    	ReanudarPartida rp = new ReanudarPartida();
    	rp.setVisible(true); 
    }                                                 

    private void buttonTutorialActionPerformed(java.awt.event.ActionEvent evt) {                                               
    	this.setVisible(false);
    	Tutorial t = new Tutorial();
    	t.setVisible(true); 
    }                                              

    private void buttonEliminarParActionPerformed(java.awt.event.ActionEvent evt) {                                                  
    	this.setVisible(false);
    	EliminarPartida ep = new EliminarPartida();
    	ep.setVisible(true); 
    }                                                 

    private void buttonEstadisticasActionPerformed(java.awt.event.ActionEvent evt) {                                                   
    	this.setVisible(false);
    	MejoresPartidas mp = new MejoresPartidas();
    	mp.setVisible(true);
    }                                                  

    private void buttonSalirActionPerformed(java.awt.event.ActionEvent evt) {                                            
    	this.setVisible(false);
    	Login l = new Login();
    	l.setVisible(true); 
    	
    }                                           

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Menu().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify
    private javax.swing.JButton buttonEliminarPar;
    private javax.swing.JButton buttonEstadisticas;
    private javax.swing.JButton buttonNuevaPar;
    private javax.swing.JButton buttonReanudarPar;
    private javax.swing.JButton buttonSalir;
    private javax.swing.JButton buttonTutorial;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    // End of variables declaration
}
